/*
 * @Author: Meow
 * @Date: 2019-10-11 16:25:12
 * @LastEditors: Civet
 * @LastEditTime: 2019-11-01 09:33:49
 * @Description: 辅助功能
 */

import https from "../http";
const WSB_API = process.env.NODE_ENV == "development" ? "/wsbUrl" : `${process.env.JZT_API}`;


const moreUseApi = {
  // 标签管理------------------------------------------------------------
  // -查询标签信息   Parameter ：pageNum pageSize lableName
  queryLabelInfo: function (query) {
    return https({
      url: `${WSB_API}/label/queryLabelInfo`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  // -添加标签   Parameter ：parentId labelName labelType isValid description
  addLabel: function (query) {
    return https({
      url: `${WSB_API}/label/addLabel`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  // -所属父级标签列表
  findLabelList: function (query) {
    return https({
      url: `${WSB_API}/label/findLabelList`,
      method: 'get',
      headers: {
        sendKey: "findLabelList"
      },
      params: query
    })
  },

  // -删除标签
  deleteLabelById: function (query) {
    return https({
      url: `${WSB_API}/label/deleteLabel`,
      method: 'get',
      headers: {
        sendKey: "deleteLabelById"
      },
      params: query
    })
  },
  //  获取字典表分页信息
  findAllDictTypeInfo: function (query) {
    return https({
      url: `${WSB_API}/dict/findAllDictTypeInfo`,
      method: 'get',
      headers: {
        sendKey: "findAllDictTypeInfo"
      },
      params: query
    })
  },
  //  根据id删除字典表类型
  deleteDictTypeById: function (query) {
    return https({
      url: `${WSB_API}/dict/deleteDictTypeById`,
      method: 'get',
      headers: {
        sendKey: "deleteDictTypeById"
      },
      params: query
    })
  },
  //  新增字典表类型
  addDictType: function (data) {
    return https({
      url: `${WSB_API}/dict/addDictType`,
      method: 'post',
      headers: {
        sendKey: "addDictType"
      },
      data: data
    })
  },
  //  根据字典类型查询字典信息(分页)
  findAllDictInfoByType: function (data) {
    return https({
      url: `${WSB_API}/dict/findAllDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "findAllDictInfoByType"
      },
      params: data
    })
  },
  //  删除字典参数
  deleteDictByDictId: function (data) {
    return https({
      url: `${WSB_API}/dict/deleteDictByDictId`,
      method: 'get',
      headers: {
        sendKey: "deleteDictByDictId"
      },
      params: data
    })
  },
  // 新增字典参数
  addDictInfo: function (data) {
    return https({
      url: `${WSB_API}/dict/addDictInfo`,
      method: 'post',
      headers: {
        sendKey: "addDictInfo"
      },
      data: data
    })
  },
  //  根据dictId修改字典参数
  updateDictTypeByDictId: function (data) {
    return https({
      url: `${WSB_API}/dict/updateDictNameByDictId`,
      method: 'get',
      headers: {
        sendKey: "updateDictTypeByDictId"
      },
      params: data
    })
  },
  //  获取所有参数的下拉列表
  queryDictList: function (data) {
    return https({
      url: `${WSB_API}/dict/queryDictList`,
      method: 'get',
      headers: {
        sendKey: "queryDictList"
      },
      params: data
    })
  },
  //  查询数据版本规则管理
  queryDataVersionRuleInfo: function (data) {
    return https({
      url: `${WSB_API}/DataVersionRule/queryDataVersionRuleInfo`,
      method: 'get',
      headers: {
        sendKey: "queryDataVersionRuleInfo"
      },
      params: data
    })
  },
  //  新增数据规则
  addDataRule: function (data) {
    return https({
      url: `${WSB_API}/DataVersionRule/addDataRule`,
      method: 'get',
      headers: {
        sendKey: "addDataRule"
      },
      params: data
    })
  },
  //  启停数据规则
  updateDataRuleById: function (data) {
    return https({
      url: `${WSB_API}/DataVersionRule/updateDataRuleById`,
      method: 'get',
      headers: {
        sendKey: "updateDataRuleById"
      },
      params: data
    })
  },
  //  删除数据规则
  deleteDataRuleByRuleId: function (data) {
    return https({
      url: `${WSB_API}/DataVersionRule/deleteDataRuleByRuleId`,
      method: 'get',
      headers: {
        sendKey: "deleteDataRuleByRuleId"
      },
      params: data
    })
  },
  //  查询制定对象下拉列表
  queryDictInfoByType: function (data) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "queryDictInfoByType"
      },
      params: data
    })
  },
  //  修改标签
  updateLabelById: function (data) {
    return https({
      url: `${WSB_API}/label/updateLabelById`,
      method: 'get',
      headers: {
        sendKey: "updateLabelById"
      },
      params: data
    })
  }
}


export default moreUseApi
